<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/27
  Time: 12:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>添加</title>
</head>
<body>
<div class="agileits-modal modal fade" id="myModal88" tabindex="-1" role="dialog" aria-labelledby="myModal88"
     aria-hidden="true">
    <input type="hidden" id="uid" value="${user.getId()}">
    <div class="modal-dialog" id="cs" >
        <div class="modal-content">
            <div class="modal-header">
                <!-- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> -->
                <h4 class="modal-title" id="myModalLabel"><i class="fa fa-map-marker" aria-hidden="true"></i>所在城市:
                </h4>
            </div>
            <div class="modal-body modal-body-sub">
                <h5>选择您的送货城市和地点 </h5>
                <p>
                    <select class="form-control bfh-states" id="province" data-country="CN" data-state="CA">
                        <option value="-1" selected>选择收货省份</option>
                    </select>
                    <select class="form-control bfh-states" id="city" data-country="CN" data-state="CA">
                        <option value="-1" selected>选择您的收货城市</option>
                    </select>
                </p>
                <input type="text" name="Name" placeholder="请输入收货地址的街道信息" onfocus="this.placeholder=''" class="address" id="adress"
                       required>
                <button type="button" class="close2" data-dismiss="modal" aria-hidden="true" id="add">确认</button>
            </div>
        </div>
    </div>
</div>
<script src="js/jquery-3.5.1.js"></script>
<script src="js/address.js"></script>
<script>
    $(document).ready(function(){
        $("#add").on("click",function () {
            if($("#province").val()!=null){
                if($("#city").val()!=null){
                    if($("#adress").val()!=null){
                        var info=$("#province").val()+$("#city").val()+$("#adress").val();
                        $.ajax({
                            "url":"adress.do",
                            "type":"get",
                            "dataType":"json",
                            "data":{"option":"add","uid":$("#uid").val(),"info":info},
                            "success":function (result) {
                                location.href="adressList.jsp";
                            }
                        });
                    }
                }
            }


        });

    });
    $("#province,#city").css({"width": "40%"});
    $("#province").css({"float": "left"});
</script>
<script>
    $('.btnt').click(function(){
        $("#cs").css("display","none");
    });
</script>
</body>
</html>
